function arrTurnToString (val) {
  if (!val || val.length < 1) return ''
  let tmpVal = []
  for (let i = 0; i < val.length; i++) {
    tmpVal.push(val[i].userName)
  }
  return tmpVal.join('、')
}
function filterWeekStr (val) {
  switch (val) {
    case 1 :
      return '周一'
    case 2 :
      return '周二'
    case 3 :
      return '周三'
    case 4 :
      return '周四'
    case 5 :
      return '周五'
    case 6 :
      return '周六'
    case 0 :
      return '周日'
    case '1' :
      return '周一'
    case '2' :
      return '周二'
    case '3' :
      return '周三'
    case '4' :
      return '周四'
    case '5' :
      return '周五'
    case '6' :
      return '周六'
    case '7' :
      return '周日'
  }
}

/**
 * @param date
 * @returns {string}
 */
function dateFormats (date) {
  if (!date) {
    return '请选择(必选)'
  }
  // date = date.replace(/-/g, '/')
  let fullYear = new Date(date).getFullYear()
  let month = (new Date(date).getMonth() + 1)
  let day = new Date(date).getDate()
  month = month < 10 ? '0' + month : month
  day = day < 10 ? '0' + day : day
  return fullYear + '-' + month + '-' + day
}
export {
  arrTurnToString,
  filterWeekStr,
  dateFormats
}
